The invention relates to software programming and in particular a method for encapsulating large scale legacy software code.
Reference is hereby made to one microfiche appendix having twenty-nine frames.
Older legacy software was typically written using a large set of global variables which could not be used in multiple instances. In an unencapsulated form it is impossible to determine the underlying legacy structure as an object type in which multiple instances can be incarnated.
Encapsulation can be described as the bundling of data together with the member functions describing how the data can be used to form an object. This allows an object to be used in different parts of an application, or different object instances, without affecting the integrity of the data. In other words, the use of an object in one instance leaves data associated with other object instances unaffected.
Improving or writing new software applications, legacy software code may be reused. In such cases, portions of the original legacy code are incorporated into the newly written code requiring the formation of multiple object instances of data from the original legacy code. In such cases its preferred that most, if not all instances of variables with global declarations which are accessible by all functions, be eliminated or otherwise encapsulated to create objects in order to preserve the integrity of the data in the legacy code. While this might be a relatively easy task when a few files and directories are involved, it becomes significantly more tedious, labor intensive and error prone as the scale of the code increases.
Several methods have been used in the art to encapsulate legacy code. The first of these methods is a manual approach. Normally, the code is kept in the original language when the manual approach is used. The manual approach can be laborious and error prone and therefore the cost increases significantly with the size of the code.
A second approach has been to transform the original code into: an object-oriented language such as C++ permitting direct encapsulation of data. This approach is also limited, however, since it is costly and impractical for large scale code. This is especially true if the original code was written prior to the American National Standards Institute Code for xe2x80x9cCxe2x80x9d with no type checking built in.
In this regard there is a need for a more economical, faster and more reliable method for data encapsulation in large scale legacy software code.
A method for data encapsulation in large scale legacy software code comprising the steps of:
(a) generating a symbol table output from the legacy software code;
(b) automatically scanning the symbol table to determine global variables therein; and
(c) replacing the global variables with an object for use in one or more separate object instances.